package cn.itcast.homework.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author 虎哥
 */
@Data
@Document(indexName = "item", type = "docs", shards = 3, replicas = 1)
public class Item {
    @Id
    @Field(type = FieldType.Keyword)
    private Long id;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String title;// 标题
    @Field(type = FieldType.Keyword, index = false)
    private String image;// 图片
    private Long sold;// 销量
    private Long price;// 价格
    @Field(type = FieldType.Keyword)
    private String ram;// 内存
    @Field(type = FieldType.Keyword)
    private String rom;// 机身存储
    @Field(type = FieldType.Date)
    private Date updateTime;
}